<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/commons :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>标签管理</title>
<!--    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">-->
<!--    <link rel="stylesheet" th:href="@{/css/semantic.min.css}">-->
<!--    <link rel="stylesheet" th:href="@{/css/style.css}">-->
</head>
<body>

    <!--头部导航开始-->
    <!--thymeleaf 片段替换-->
    <div th:replace="admin/commons :: header(3)"></div>
    <!--头部导航结束-->

    <!--二级导航-->
    <div class="ui attached pointing menu">
        <div class="ui container">
            <div class="right menu">
                <a th:href="@{/admin/tags/input}" class="item">新增</a>
                <a th:href="@{/admin/tags}" class="teal active item">列表</a>
            </div>
        </div>
    </div>

    <!--中间部分开始-->
    <div class="v-container-small v-padded-tb-big">
        <div class="ui container">
            <!--添加分类是否成功提示信息-->
            <div class="ui success message" th:unless="${#strings.isEmpty(msg)}">
                <i class="close icon"></i>
                <div class="header">提示:</div>
                <p th:text="${msg}"></p>
            </div>

            <table class="ui teal sortable celled table">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>标签</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr th:each="tag,iterStat : ${page.content}">
                        <td>[[${iterStat.count}]]</td>
                        <td th:text="${tag.name}"></td>
                        <td>
                            <a th:href="@{/admin/tags/{id}/input(id=${tag.id})}" class="ui mini teal basic button">编辑</a>
                            <a th:href="@{/admin/tags/{id}/delete(id=${tag.id})}" class="ui mini red basic button">删除</a>
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <th colspan="6">
                            <div class="ui mini pagination menu" th:if="${page.totalPages} >1">
                                <a th:href="@{/admin/tags/(page=${page.number} - 1)}" th:unless="${page.first}" class="icon item">
                                    <i class="left chevron icon"></i>
                                </a>
                                <a href="#" class="item">1</a>
                                <a href="#" class="item">2</a>
                                <a href="#" class="item">3</a>
                                <a th:href="@{/admin/tags/(page=${page.number} + 1)}" th:unless="${page.last}" class="icon item">
                                    <i class="right chevron icon"></i>
                                </a>
                            </div>
                            <a th:href="@{/admin/tags/input}" class="ui mini right floated blue basic button"><i class="add icon"></i>新增</a>
                        </th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
    <!--中间部分结束-->
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>

    <!--底部部分开始-->
    <!--thymeleaf 片段替换-->
    <div th:replace="admin/commons :: #footer"></div>
    <!--底部部分结束-->


<!--<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>-->
<!--<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>-->
<!--<script th:src="@{/js/jquery-3.6.0.min.js}"></script>-->
<!--<script th:src="@{/js/semantic.min.js}"></script>-->

<!--/*/<th:block th:replace="admin/commons :: script">/*/-->
    <!--thymeleaf 引入js资源，这三行不为注释-->
<!--/*/</th:block>/*/-->
<script>
    $('.menu.toggle').click(function () {
        $('.v-item').toggleClass('v-mobile-hidden')
    });

    $('.ui.dropdown').dropdown({
        on: 'hover'
    });

    //消息提示关闭
    $('.message .close').on('click', function() {
        $(this).closest('.message').transition('fade');
    });


</script>
</body>
</html>

